using System.Collections.Generic;
using Microsoft.Practices.Prism.ViewModel;
using TFS.Kanban.Domain;

namespace TFS.Kanban.Modules.ProjectExplorer.ViewModels
{
    public class IterationViewModel : NotificationObject
    {
        public IterationViewModel(IIteration iteration)
        {
            Iteration = iteration;
        }

        public IIteration Iteration { get; private set; }
        public string Display { get { return Iteration.ToString(); } }
        public string Name { get { return Iteration.Name; } }
        public int Id { get { return Iteration.Id; } }

        public IEnumerable<IArea> Areas { get { return Iteration.Areas; } }

        /// <summary>
        /// Property for the TreeViewItem associated with this object is expanded.
        /// </summary>
        private bool _isExpanded;
        public bool IsExpanded
        {
            get { return _isExpanded; }
            set
            {
                if (value != _isExpanded)
                {
                    _isExpanded = value;
                    RaisePropertyChanged(() => IsExpanded);
                }
            }
        }

        /// <summary>
        /// Property for the TreeViewItem associated with this object is selected.
        /// </summary>
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                if (value != _isSelected)
                {
                    _isSelected = value;
                    RaisePropertyChanged(() => IsSelected);
                }
            }
        }
    }
}